/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package MatrixCalculation;

import RatingMatrix.ArrayRateMatrix;

/**
 *
 * @author Brahmarup
 */
public class RatingMatrix {

    public int getNoOfUsers() {
        return noOfUsers;
    }

    public void setNoOfUsers(int noOfUsers) {
        this.noOfUsers = noOfUsers;
    }

    public int getNoOfServices() {
        return noOfServices;
    }

    public void setNoOfServices(int noOfServices) {
        this.noOfServices = noOfServices;
    }

    int noOfUsers,noOfServices;
    
    public int[][] getRatMatrix() {
        return ratMatrix;
    }

    public void setRatMatrix(int[][] ratMatrix) {
        this.ratMatrix = ratMatrix;
    }

    public RatingMatrix() {
        this.setRatingMatrix();
   }
    private int[][] ratMatrix = new int[noOfUsers][noOfServices];
    public int i,j;
    /**
     * populating the matrix from the functions available here 
     * Niraj
     */
     public void setRatingMatrix(){

         ArrayRateMatrix alrm = new ArrayRateMatrix();
        //alrm.insertQuery();
        alrm.setArrayList();
        this.setNoOfServices(alrm.getNoOfServices());
        this.setNoOfUsers(alrm.getNoOfUsers());
        this.setRatMatrix(alrm.getArrayMatrix());    
     }
     
     public void printMatrix(){
        System.out.println("No. of Services :" + this.getNoOfServices());
        System.out.println("No. of Users : " + this.getNoOfUsers());
        System.out.println("Print Matrix ");
        for(int i = 0;i<this.getNoOfServices();i++){
            for(int j = 0;j<this.getNoOfUsers();j++){
                System.out.print(this.getRatMatrix()[i][j] + "\t");
            }
            System.out.println();
        }
     }
     
    public static void main(String args[])
    {
        RatingMatrix rm = new RatingMatrix();
        rm.printMatrix();

    }           
}
